#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll s[100010],p[100010];
struct node{
    ll d,v,a
    double sf=0,sr=0;
}s[100010];
int main(){
    freopen("detect.in","r",stdin);
    freopen("detect.out","w",stdout);
    ll tt;
    scanf("%d",&tt);
    while(tt--){
        ll n,m,l,maxv,ans1=0,ans2=0;
        for(int i=1;i<=n;i++)
            scanf("%d %d %d",&s[i].d,&s[i].v,&s[i].a);
        for(int i=1;i<=m;i++)
            scanf("%d",&p[i]);
        for(int i=1;i<=n;i++){
            if(s[i].a==0)
                if(s[i].v>maxv){
                        s[i].sf=s[i].d;
                        s[i].sr=l;
                }
           if(s[i].a>0){
               double x=sqrt(pow(s[i].v,2)+2*s[i].a*(l-s[i].d));
                if(x>maxv){
                    double t=(maxv-s[i].v)/s[i].a;
                s[i].sf=s[i].d+s[i].v*t+0.5*s[i].a*t*t;
                s[i].sr=l;
                }
           }
           if(s[i].a<0){
                if(s[i].v>maxv){
                    s[i].sf=s[i].d;
                    double t=(s[i],v-maxv)/s[i].a;
                    s[i].sr=s[i].d+s[i].v*t+0.5*s[i].a*t*t;
                }
           }
        }
        bool c[100010][100010];
        for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++){
            if(p[j]>=a[i].sf&&p[j]<=a[i].sr)c[i][j]=1;
        }
        for(int i=1;i<=n;i++)
            for(int j=1;j<=m;j++)
    }
    return 0;
}
